from pathlib import Path 
from functools import lru_cache 
from pydantic_settings import BaseSettings, SettingsConfigDict

class Settings(BaseSettings): 
    database_name: str = 'cryptid.db'
    root: Path = Path(__file__).parents[1] / 'data'

    # auth 
    secret_key: str = 'haohao' 
    algorithm: str = 'HS256' 
    access_token_expire_minutes: int = 30 
    
    model_config = SettingsConfigDict(
        env_file='.env', 
        env_file_encoding='utf-8'
    )

    
   

@lru_cache
def get_settings() -> Settings: 
    return Settings()